#
# The Coffee.pm file to illustrate inheritance.
#
package Coffee;
require Exporter;
require Bean;                   # add parent class
@ISA = qw(Exporter, Bean);
@EXPORT = qw(setImports, declareMain, closeMain);
#
# set item
#
sub setCoffeeType{
  my ($class,$name) = @_;
  $class->{'Coffee'} = $name;
  print "Set coffee type to $name \n";
  }
  
sub printType {
  my $class = shift @_;
  print "The type of Coffee is $class->{'Coffee'} \n";
}

#
# constructor
#
sub new {
  my $type = shift;
  my $this = Bean->new(); ##### <- LOOK HERE!!! ####
  $this->{'Coffee'} = 'Instant'; # unless told otherwise
  bless $this, $type;
  return $this;
  }
1;